#include "InputManager.h"
#include "Widget.h"
#include <windows.h>

namespace hgui
{
	template <> InputManager *Singleton<InputManager>::instance = nullptr;
	template <> const char *Singleton<InputManager>::className = "InputManager";

	void InputManager::pushWidget(Widget *widget)
	{
		mWidgets.push_back(widget);
	}

	void InputManager::update()
	{
		LPPOINT pos;
		GetCursorPos(pos);
		for (UInt32 i = 0; i < mWidgets.size(); i++)
		{
			if (mWidgets[i]->isEnable())
			{
				if ((pos->x >= mWidgets[i]->getCoords().x && pos->y <= mWidgets[i]->getCoords().x + mWidgets[i]->getCoords().w) &&
					(pos->y >= mWidgets[i]->getCoords().y && pos->y <= mWidgets[i]->getCoords().y + mWidgets[i]->getCoords().h))
				{
				}
			}
		}
	}
} // namespace hgui